package testClasses.misc;

import java.util.HashMap;
import java.util.logging.Level;
import java.util.logging.Logger;

import testClasses.ATest;
import testClasses.TestingSystem;
import utilities.Key;
import utilities.MVCMaker;
import view.EViewList;
import view.View;

import com.jme3.asset.AssetManager;
import com.jme3.material.Material;
import com.jme3.scene.Node;
import com.jme3.scene.shape.Quad;

import controller.AbstractController;
import eventManager.EventManager;
import events.stateMachine.strategyState.DefaultViewEvent;

public class TestTextureCoords extends ATest {

	private static final Logger logger = Logger.getLogger(TestTextureCoords.class.getName());
	
	public TestTextureCoords(TestingSystem system) {
		super(system);
		this.name = "TestTextureCoords";
	}

	public boolean execute() {
		logger.log(Level.INFO, "TestTextureCoords: execute()");
		
		HashMap<Key, AbstractController> controllerMap = new HashMap<Key, AbstractController>();
		eventManager.addControlMapReference(controllerMap);
		
		MSquareTile tileModel = new MSquareTile();
		CSquareTile tileControl = new CSquareTile(eventManager);
		
		//Material material = new Material(assets, "Common/MatDefs/Misc/Unshaded.j3md");
				
		HashMap<EViewList,View> tileView = new FVSquareTile().buildViews(assetManager);
		
		System.out.println(tileView.get(EViewList.DEFAULT).getName().toString());
		
		MVCMaker.linkElements(tileModel, tileView, tileControl);
		
		eventManager.addAllListeners(tileControl, tileControl.getEvents().keySet());
		
		controllerMap.put(tileModel.getKey(), tileControl);
		
		eventManager.queueEvent(new DefaultViewEvent(node));
		eventManager.procEvents(1000);
		
		return true;
	} 

}
